//package com.b2c.wms.kafka;
//
//import com.alibaba.fastjson.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.kafka.core.KafkaTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.Date;
//import java.util.UUID;
//@Component
//public class KafkaProducer {
//
//    private static Logger logger = LoggerFactory.getLogger(KafkaProducer.class);
//
//    @Resource
//    private KafkaTemplate<String, String> kafkaTemplate;
//    //发送消息方法
//    public void send() {
////        for(int i=0;i<5;i++){
//            HelloMessageTemplate message = new HelloMessageTemplate();
//            message.setId(System.currentTimeMillis());
//            message.setMsg(UUID.randomUUID().toString()+ "---" );
//            message.setSendTime(new Date());
//
//            logger.info("发送消息 ----->>>>>  message = {}", JSONObject.toJSONString(message));
//            kafkaTemplate.send("hello", JSONObject.toJSONString(message));
////        }
//    }
//
//}
